<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul,
        ol {
            list-style: none;
        }
        .erweima {
            width: 100px;
            height: 100px;
            background-color: skyblue;
        }
        .show {
            display: block;
        }
        .hide {
            display: none;
        }
        
    </style>
</head>

<body>
    <div class="erweima hide" id="box"></div>
    <script>
        var box = document.getElementById("box")

        // 方法1 
        // box.classList.replace("hide","show")

        // 方法2
        // box.setAttribute('class', "erweima show")

        // 方法3
        // box.classList = "erweima show"

        // 方法4
        box.className = "erweima show"
    </script>

</body>

</html>